<template>
  <div>

    <div>
      <el-table :data="tableData0">
        <el-table-column label="进行中">
        <el-table-column label="作业名" align="center" prop="title" /></el-table-column>
        <el-table-column label="开始时间" align="center" prop="startTime"/>
        <el-table-column label="结束时间" align="center" prop="endTime" />
        <el-table-column label="创建时间" align="center" prop="createTime" />
        <el-table-column label="创建者" align="center" prop="creator" />
      </el-table>
    </div>



    <div>
      <el-table :data="tableData1">
        <el-table-column label="已过期">
        <el-table-column label="作业名" align="center" prop="title" /></el-table-column>
        <el-table-column label="开始时间" align="center" prop="startTime"/>
        <el-table-column label="结束时间" align="center" prop="endTime" />
        <el-table-column label="创建时间" align="center" prop="createTime" />
        <el-table-column label="创建者" align="center" prop="creator" />
      </el-table>
    </div>

    <div>
      <el-table :data="tableData2">
        <el-table-column label="未开始">
        <el-table-column label="作业名" align="center" prop="title" /></el-table-column>
        <el-table-column label="开始时间" align="center" prop="startTime"/>
        <el-table-column label="结束时间" align="center" prop="endTime" />
        <el-table-column label="创建时间" align="center" prop="createTime" />
        <el-table-column label="创建者" align="center" prop="creator" />
      </el-table>
    </div>

  </div>
</template>

<script>

  import { Now,After,Before} from "@/api/topic";

  export default {
        name: "topic",
      created() {
        Now(19101).then(response => {
          this.tableData0 = response
        })
        After(19101).then(response => {
          this.tableData1 = response
        })
        Before(19101).then(response => {
          this.tableData2 = response
        })
      },
      data(){
        return {
          dialogFormVisible:false,
          form:{},
          tableData0:{
            name: undefined,
            classId:undefined,
            teacherId:undefined
          },
          tableData1:{
            name: undefined,
            classId:undefined,
            teacherId:undefined
          },
          tableData2:{
            name: undefined,
            classId:undefined,
            studentId:undefined
          },
          queryParams: {
            pageNum: 1,
            pageSize: 10,
            teacherId: null,
          }
        }
      },
      methods: {
        searchTopic() {
          getListT(this.queryParams.teacherId).then(response =>{
              this.tableData1  = response
            }
          );
        },
        B() {
          getListS(this.queryParams.studentId).then(response =>{
            this.tableData2  = response
          })
        },
        classAdd(){
          this.dialogFormVisible = true,
            this.form = {}
        },
        save(){
          saveClass(this.form).then(response =>{
            if (response.code === 200){
              this.$message.success("添加课程成功")
              this.dialogFormVisible = false
              this.load()
            }else {
              this.$message.error("添加课程失败")
            }
          })
        },
        classEdit(row){
          this.form = row
          this.dialogFormVisible = true
        },

      }
    }
</script>

<style scoped>

</style>
